<template>
  <div class="container">
    <wxc-indexlist :normal-list="list"
      @wxcIndexlistItemClicked="wxcIndexlistItemClicked"
      :show-index="showIndex"></wxc-indexlist>
  </div>
</template>
<style>
  .container, .container .wxc-index-list, .weex-list {
    height:100%!important;
  }
</style>
<script>
  const modal = weex.requireModule('modal');
  
  import { WxcIndexlist } from 'weex-ui';
  import { Department } from '../http'
  
  export default {
    components: { WxcIndexlist },
    data: () => ({
      list: [],
      showIndex: true,
    }),
    methods: {
      wxcIndexlistItemClicked (e) {
        console.log(e)
      }
    },
    created () {
      Promise.resolve(Department.leaders()).then(response => {
        this.list = response.data
      })
    }
  };
</script>